package com.hqx;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    @Test
    public void testRun(){
        System.out.println("测试新版idea2022.2运行情况");
    }
    @Test
    public void getBean(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");
        User user = (User)applicationContext.getBean("userBean");
        System.out.println(user);
        User user2 = (User)applicationContext.getBean("userBean2");
        System.out.println(user2);
        User user3 = (User)applicationContext.getBean("userBean3");
        System.out.println(user3);
        User user4 = (User)applicationContext.getBean("userBean4");
        System.out.println(user4);
        User user5 = (User)applicationContext.getBean("userBean5");
        System.out.println(user5);
        User user6 = (User)applicationContext.getBean("userBean6");
        System.out.println(user6);
        People people = applicationContext.getBean("people",People.class);
        System.out.println(people);
    }
    @Test
    public void startLogger(){
        Logger logger = LoggerFactory.getLogger(test.class);//输出test类中的日志信息
        logger.debug("debug级别信息");
        logger.info("info级别信息");
        logger.error("error级别信息");
    }
}
